<%--
  Created by IntelliJ IDEA.
  User: 22561
  Date: 2025/6/23
  Time: 11:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>用户列表</title>
</head>
<body>
<h2>用户列表</h2>
<a  href="${pageContext.request.contextPath}/user/add">添加用户</a>
<table border="1">
    <tr>
        <th>ID</th>
        <th>用户名</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>电话</th>
        <th>性别</th>
        <th>年龄</th>
        <th>身高</th>
        <th>体重</th>
        <th>BMI</th>
        <th>时间</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${users}" var="user">
        <tr>
            <td>${user.userid}</td>
            <td>${user.username}</td>
            <td>${user.password}</td>
            <td>${user.email}</td>
            <td>${user.phone}</td>
            <td>${user.sex}</td>
            <td>${user.age}</td>
            <td>${user.height}</td>
            <td>${user.weight}</td>
            <td>${user.bmi}</td>
            <td>${user.createtime}</td>
            <td>
                <a href="${pageContext.request.contextPath}/user/edit/${user.userid}">编辑</a>
                <a href="${pageContext.request.contextPath}/user/delete/${user.userid}" onclick="return confirm('确定删除吗？')">删除</a>
            </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
